<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="/WEB-INF/tlds/c.tld" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>郴州互娱</title>
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0">
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link href="http://jujin.oss-cn-shenzhen.aliyuncs.com/static/wap/css/weui.css" rel="stylesheet">
<link href="http://jujin.oss-cn-shenzhen.aliyuncs.com/static/plugins/icon108/mmiconfont.css" rel="stylesheet">
<link href="http://jujin.oss-cn-shenzhen.aliyuncs.com/static/wap/css/wap.css" rel="stylesheet">
<script src="http://jujin.oss-cn-shenzhen.aliyuncs.com/static/plugins/jquery/jquery-3.1.1.min.js"></script>
<!-- <script src="http://jujin.oss-cn-shenzhen.aliyuncs.com/static/plugins/layer/mobile/layer.js"></script> -->
<link href="http://jujin.oss-cn-shenzhen.aliyuncs.com/static/plugins/layer/mobile/need/layer.css?2.0" type="text/css" rel="styleSheet" id="layermcss">
<script src="http://jujin.oss-cn-shenzhen.aliyuncs.com/static/js/common.js"></script>
<script src="http://jujin.oss-cn-shenzhen.aliyuncs.com/static/plugins/TouchSlide.1.1.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/layerui/layer.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/layerui/layer.ext.js"></script>



<style>
  .index-box-title {
	text-align: left
} 

.index-item-body {
    width: 100%;
}
.discount {
	font-size: 14px;
	color: #f6ac56
} 
 .layui-layer {
	 width: 80%; 
	top: 50% !important;
	left: 10% !important;
	transform: translateX(-50%) !important;
	-webkit-transform: translateX(-50%) !important;
} 
</style>
</head>
<body>
	<div class="main-box">
		<!--图片轮播-->
		
		<script type="text/javascript">
			$(function() {
				$('.focus').show();
				TouchSlide({
					slideCell : "#focus",
					titCell : ".hd ul", //开启自动分页 autoPage:true ，此时设置 titCell 为导航元素包裹层
					mainCell : ".bd ul",
					effect : "left",
					autoPlay : true,//自动播放
					autoPage : true, //自动分页
					switchLoad : "_src" //切换加载，真实图片路径为"_src"
				});
			})
		</script>
		<!--商品-->
		<div class="index-box">
			<div class="index-box-title">
				<!-- <div class="title-logo">
					<img
						src="http://jujin.oss-cn-shenzhen.aliyuncs.com/uploads/images/20170307/7f9306fea0c8a30a3b91eea59b7c9c0a.png"
						width="100%">  
					<img width="100%" style="width: 22px;height: 22px;"  src="${pageContext.request.contextPath}/images/theme/agent.png">
				</div>  -->
				激活成为推广大使
			</div>
			<div class="index-box-body">
				<ul class="index-list goods">
					<li class="index-item line_bottom" style="background-color: rgb(251,251,251)">
						<div class="index-item-body">
					<c:if test="${userList.size()>=4}">
					
					您已成功邀请${userList.size()}名新用户，可成为推广大使，享受粉丝用户每笔房卡充值金额的25%作为分红，邀请10名以上新用户更可申请成为代理合伙人，享受更高比例的分红！感谢您的支持！
					</c:if>
					<c:if test="${userList.size()<4}">
					
					您已成功邀请${userList.size()}名有效用户（
						<c:forEach items="${userList}" var="user" begin="0"  end="4" >
						“${user.outUserName}”、
						</c:forEach>
					新用户玩了一局以上后即为有效用户），目前只差${4-userList.size()}名，加油继续邀请，感谢您的支持！
					
					</c:if>
					
					</div></li>
					<%-- <li class="index-item line_bottom" style="background-color: rgb(251,251,251)">
						<div class="index-item-body">
						<table width="100%">
						<tr >
						<td width="55%">
						<span style="border:none;padding: 0.2rem;">昵称</span>
						</td>
						<td width="20%">
						<span style="border:none;padding: 0.2rem;">玩家ID</span>
						</td>
						<td width="30%">
						<span style="border:none;padding: 0.2rem;">加入时间</span>
						</td>
						</tr>
						</table>
						</div>
					</li>
					
					<c:forEach items="${userList}" var="user" begin="0"  end="4" >
                		<li class="index-item line_bottom">
						<div class="index-item-body"> 
						<table width="100%">
						<tr><td width="55%">
						<span style="border:none;font-size: 14px">${user.outUserName}</span>
						</td><td width="20%">
						<span style="border:none;font-size: 14px;">${user.gameUserId}</span>
						</td><td width="25%">
						<span style="border:none;font-size: 14px;">
							<fmt:formatDate value="${user.createTime}" type="both" pattern="yyyy-MM-dd"  />
						</span>
						</td></tr>
						</table>
						</div>
						</li> 
               		</c:forEach> 
					
					<li class="index-item line_bottom">
						<div class="index-item-body">
						<table width="100%">
						<tr>
						<td width="50%">
						<span style="border:none;padding: 0.2rem;">...</span>
						</td>
						<td width="50%">
						<span style="border:none;padding: 0.2rem;">共邀请${userList.size()}位有效玩家</span>
						</td>
						
						</tr>
						</table>
						</div>
					</li> --%>
					
					<li class="index-item line_bottom">
					<div class="down">
								<a id="usersave" onclick="addAgentCheck()" href="javascript:;" data-msg=""
									class="weui-btn weui-btn_primary">激活推广大使</a>
						</div>
						<div class="index-item-body">
    					</div>
					</li>
				</ul>
				<p style="font-size: 11px;color:#888a85; ">【发展4名玩了一局的新用户即可成为推广大使，享受粉丝用户的</p>
				<p style="font-size: 11px;color:#888a85; ">&nbsp; 房卡充值的25%的分红，郴州互娱感谢您的支持！】</p>
			<!-- <div style="font-size: 11px;color:#888a85; " class="index-box">
			【亲爱的用户，您好！如果您对申请代理有任何疑问，可咨询官方客服：微信号xxx，感谢您的支持！】
			</div> -->
			
			</div>
		</div>

	</div>
	

<style>
.weui-tabbar__label {
	font-size: 14px;
}
</style>
	<div style="height: 50px;"></div>
	<script>
		$(function() {
			var ua = navigator.userAgent.toLowerCase();
		    if (ua.match(/MicroMessenger/i) == "micromessenger") {
		        //return true;
		    } else {
		    	//$("#isweixinDiv").css("display", "none");  
		    }
			
			var controller = "Shop";
			var action = "index";
			$('#tabbar-' + controller + '-' + action).addClass(
					'weui-bar__item_on');
			
			
		});
		
		
		
		var msg='${msg}';
		if(msg){
	   		layer.msg(msg);
	   	}
		
		
		function addAgentCheck(){
			if(msg){
		   		layer.msg(msg);
		   		return;
		   	} 
			$('#usersave').attr('disabled',"true"); //添加disabled属性 
			$.ajax({
	             type: "POST",
	             url: "${pageContext.request.contextPath}/wechat/player_to_user_tgds_save.html",
	             data: null,
	             dataType: "json",
	             success: function(data){
	            	 $('#usersave').removeAttr("disabled");  //移除disabled属性 
						layer.alert(data.message);
						if(data.statusCode =='200'){
							setTimeout("addAgentCancel()",3000);
							window.location.href="${pageContext.request.contextPath}/admin/index_mobile.html";
						}
	             },
	             error: function() {
	            	 layer.alert("服务器异常，请稍后再试~");
	             }
			});
			
		}
	</script>

</body>
</html>